'use strict'

/** @type {import('sequelize-cli').Migration} */
module.exports = {
  async up(queryInterface, Sequelize) {
    const { INTEGER, STRING, DATE } = Sequelize
    // 创建表
    await queryInterface.createTable('wall', {
      id: {
        type: INTEGER(20).UNSIGNED,
        primaryKey: true,
        autoIncrement: true
      },
      title: {
        type: STRING(20),
        allowNull: false,
        comment: '标题'
      },
      slogan: {
        type: STRING(200),
        allowNull: false,
        comment: '标语'
      },
      created_time: DATE
    })
  },
  async down(queryInterface, Sequelize) {
    await queryInterface.dropTable('wall')
  }
}
